package cn.hdu.liang.typeinfo;

class Candy {
    static {
        System.out.println("载入 Candy");
    }
}

class Gum {
    static {
        System.out.println("载入 Gum");
    }
}

class Cookie {
    static {
        System.out.println("载入 Cookie");
    }
}

public class SweetShop {
    public static void main(String[] args) {
        System.out.println("main 函数");
        new Candy();
        System.out.println("创建 Candy");
        try {
            Class.forName("cn.hdu.liang.typeinfo.Gum");
        } catch(ClassNotFoundException e) {
            System.out.println("Couldn't find Gum");
        }
        System.out.println("使用Class.forName() 创建 Gum");
        new Cookie();
        System.out.println("创建 Cookie");
    }
}
